-- GENERATED SPELL FOR [Shadowy Necromancer] --


function spell0_17899(pUnit, Event) --@Raise Dead,n/a--
pUnit:FullCastSpellOnTarget(31617,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17899', 1000, 1)
end

function spell1_17899(pUnit, Event) --@Raise Dead,n/a--
pUnit:FullCastSpellOnTarget(31624,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17899', 1000, 1)
end

function spell2_17899(pUnit, Event) --@Raise Dead,n/a--
pUnit:FullCastSpellOnTarget(31625,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17899', 1000, 1)
end

function spell3_17899(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(31627,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17899', 1500, 1)
end

function spell4_17899(pUnit, Event) --@Unholy Frenzy,n/a--
pUnit:FullCastSpellOnTarget(31626,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17899', 20000, 1)
end

function Sorts_17899(pUnit, Event)
local choix_sorts_17899 = math.random(0, 4)
if choix_sorts_17899 == 0 then
pUnit:RegisterEvent('spell0_17899', 1, 1)
end
if choix_sorts_17899 == 1 then
pUnit:RegisterEvent('spell1_17899', 1, 1)
end
if choix_sorts_17899 == 2 then
pUnit:RegisterEvent('spell2_17899', 1, 1)
end
if choix_sorts_17899 == 3 then
pUnit:RegisterEvent('spell3_17899', 1, 1)
end
if choix_sorts_17899 == 4 then
pUnit:RegisterEvent('spell4_17899', 1, 1)
end
end

function mob17899_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17899', math.random(1500, 3000), 1)
end

function mob17899_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17899_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17899_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17899, 1, 'mob17899_Action')
RegisterUnitEvent(17899, 2, 'mob17899_Leave')
RegisterUnitEvent(17899, 3, 'mob17899_Kill')
RegisterUnitEvent(17899, 4, 'mob17899_Die')
